<?php
require_once 'connect.php';

if (isset($_POST) && isset($_POST['gameName']) && isset($_POST['metacriticRating'])  && isset($_POST['gamestopRating']) && isset($_POST['ignRating'])) {
	$gameName = $_POST['gameName'];
	$metacriticRating = $_POST['metacriticRating'];
	$gamespotRating= $_POST['gamestopRating'];
	$ignRating= $_POST['ignRating'];
	connect();
	$result = updateRatings($gameName, $metacriticRating, $gamespotRating, $ignRating);

	if($result) {
		echo 'true';
	} else {
		echo 'Error updating ratings';
	}
} else {
	echo 'Unable to update';
}
?>	